package com.troll.wanandroid.adapter.system

import com.chad.library.adapter.base.entity.node.BaseNode
import com.chad.library.adapter.base.provider.BaseNodeProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.troll.eth.ex.cast
import com.troll.wanandroid.R
import com.troll.wanandroid.model.SystemKnowledgeTag

/**
 *
 * @Author:   TangPeng
 * @Time:     6/10/21
 * @Remark:
 */
class SystemTagProvider : BaseNodeProvider() {
    override val itemViewType: Int
        get() = SystemAdapter.SYSTEM_NODE_TAG
    override val layoutId: Int
        get() = R.layout.layout_item_system_tag

    override fun convert(helper: BaseViewHolder, item: BaseNode) {
        item.cast<SystemKnowledgeTag> {
            helper.setText(R.id.item_system_tv_tag, it.name)
        }
    }
}